package constructor;

public class Demo6_Employee {
    public static void main(String[] args) {
        Employee employee = new Employee("wzx",518518,15000);
        employee.work();

    }
}
/*
需求：
    定义一个员工类Employee
    自己分析出几个成员，然后给出成员变量
        姓名name  工号id    工资salary
    构造方法：
        空参和有参构造
    getXxx()和setXxx()方法
    获取一个显示所有成员信息的方法并测试
 */
class Employee {
    private String name;
    private int id;
    private double salary;

    public Employee() {

    }

    public Employee(String name,int id,double salary) {
        this.name = name;
        this.id = id;
        this.salary = salary;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public int getId() {
        return id;
    }

    public void setId(int id) {
        this.id = id;
    }

    public double getSalary() {
        return salary;
    }

    public void setSalary(double salary) {
        this.salary = salary;
    }

    public void work() {
        System.out.println("姓名："+name+"..."+"工号："+id+"...工资："+salary+"...工作");
    }
}
